package com.server;
/**
 *@author aa
 */
public class Broadcast extends Thread { 

	public Broadcast() { 
		start(); 
	} 

	public void run() { 
		while (true) { 
			if (!MyServer.isClear) { 
				String tmp = (String)MyServer.Message_Array.getFirst(); 

				for (int i = 0; i < MyServer.Threader.size(); i++) { 
					ServerThread client = (ServerThread)MyServer.Threader.get(i); 
					client.sendMessage(tmp); 
				} 

				MyServer.Message_Array.removeFirst(); 
				MyServer.isClear = MyServer.Message_Array.size() > 0 ? false : true; 
			} 
		} 
	} 
}
